# P302
# 遍历字典
students = [
    {
        "name": "臭猪头",
        "gender": False,
        "age": 26
    },
    {
        "name": "德哥",
        "gender": True,
        "age": 24
    },
    {
        "name": "韩狗逼",
        "gender": True,
        "age": 28
    },
    {
        "name": "幺妹儿",
        "gender": True,
        "age": 25
    }
]

# 在学员列表中搜索指定的姓名
find_name = "张三"

for stu_dict in students:
    if stu_dict["name"] == find_name:
        print("找到%s啦" % stu_dict["name"])
        # 如果找到了指定的人，那么直接退出循环
        break
else:
    print("没有找到%s这个人" % find_name)